package org.ladybug.service.impl;

import org.ladybug.dao.persistence.Applicazione;
import org.ladybug.service.CommandService;
import org.ladybug.service.admin.AdminService;
import org.ladybug.web.controller.model.ModelApplicativo;
import org.springframework.validation.BindException;

public class ApplicativoCommandService implements CommandService {

	private AdminService adminService ;
	
	public void delete(Object command, BindException errors) throws Exception {
		// TODO Auto-generated method stub

	}

	public void insertOrUpdate(Object command, BindException errors)
			throws Exception {
		ModelApplicativo ac = (ModelApplicativo) command;
		Applicazione applicazione = new Applicazione();
		applicazione.setCodiceApplicativo(ac.getCodiceApplicativo());
		applicazione.setDescrizione(ac.getDescrizione());
		
		adminService.saveOrUpdate(applicazione);

	}

	public AdminService getAdminService() {
		return adminService;
	}

	public void setAdminService(AdminService adminService) {
		this.adminService = adminService;
	}

}
